{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Report - Titanic\n",
    "\n",
    "* 姓名\n",
    "* 学号\n",
    "\n",
    "\n",
    "## 任务简介\n",
    "\n",
    "* 背景介绍：泰坦尼克号沉没是历史上最著名的沉船事故之一。1912年4月15日，在她的处女航中，泰坦尼克号在与冰山相撞后沉没，在2224名乘客和机组人员中造成1502人死亡。这场耸人听闻的悲剧震惊了国际社会，并为船舶制定了更好的安全规定。造成海难失事的原因之一是乘客和机组人员没有足够的救生艇。尽管幸存下沉有一些运气因素，但有些人比其他人更容易生存，例如妇女，儿童和上流社会。在这个案例中我们将运用机器学习来预测哪些乘客可以幸免于悲剧。\n",
    "\n",
    "* 任务类型：Binary Classification\n",
    "\n",
    "* 数据描述：本实验提供了两份数据: train.csv文件作为训练集构建与生存相关的模型; 另一份test.csv文件则用作测试集, 用我们构建出来的模型预测生存情况。\n",
    "\n",
    "* 最终目标：完成对泰坦尼克号上什么样的人可能存活下来的分析。要求运用机器学习的工具来预测哪些乘客在这场悲剧中幸存下来。\n",
    "\n",
    "## 解决途径：\n",
    "\n",
    "## 数据导入及探索性分析\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 忽略警告提示\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "\n",
    "#导入处理数据包\n",
    "import os\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C85</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>113803</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>C123</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>373450</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived  Pclass  \\\n",
       "0            1         0       3   \n",
       "1            2         1       1   \n",
       "2            3         1       3   \n",
       "3            4         1       1   \n",
       "4            5         0       3   \n",
       "\n",
       "                                                Name     Sex   Age  SibSp  \\\n",
       "0                            Braund, Mr. Owen Harris    male  22.0      1   \n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...  female  38.0      1   \n",
       "2                             Heikkinen, Miss. Laina  female  26.0      0   \n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)  female  35.0      1   \n",
       "4                           Allen, Mr. William Henry    male  35.0      0   \n",
       "\n",
       "   Parch            Ticket     Fare Cabin Embarked  \n",
       "0      0         A/5 21171   7.2500   NaN        S  \n",
       "1      0          PC 17599  71.2833   C85        C  \n",
       "2      0  STON/O2. 3101282   7.9250   NaN        S  \n",
       "3      0            113803  53.1000  C123        S  \n",
       "4      0            373450   8.0500   NaN        S  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#训练数据集\n",
    "train_data = pd.read_csv('data/train.csv')\n",
    "\n",
    "#查看数据\n",
    "train_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 891 entries, 0 to 890\n",
      "Data columns (total 12 columns):\n",
      " #   Column       Non-Null Count  Dtype  \n",
      "---  ------       --------------  -----  \n",
      " 0   PassengerId  891 non-null    int64  \n",
      " 1   Survived     891 non-null    int64  \n",
      " 2   Pclass       891 non-null    int64  \n",
      " 3   Name         891 non-null    object \n",
      " 4   Sex          891 non-null    object \n",
      " 5   Age          714 non-null    float64\n",
      " 6   SibSp        891 non-null    int64  \n",
      " 7   Parch        891 non-null    int64  \n",
      " 8   Ticket       891 non-null    object \n",
      " 9   Fare         891 non-null    float64\n",
      " 10  Cabin        204 non-null    object \n",
      " 11  Embarked     889 non-null    object \n",
      "dtypes: float64(2), int64(5), object(5)\n",
      "memory usage: 83.7+ KB\n"
     ]
    }
   ],
   "source": [
    "# 查看每一列的数据类型，和数据总数\n",
    "train_data.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "训练数据集总共有891条数据\n",
    "\n",
    "其中数值类型的列：年龄（Age）有缺失数据：\n",
    "\n",
    "1）年龄（Age）里面数据总数是714条，缺失了891-714=177，缺失率177/891=20%\n",
    "\n",
    "字符串列：\n",
    "\n",
    "1）登船港口（Embarked）里面数据总数是889，只缺失了2条数据，缺失比较少\n",
    "\n",
    "2）船舱号（Cabin）里面数据总数是204，缺失了891-204=687，缺失率=687/891=77%，缺失比较大"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1e2afeca940>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      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qQXDlCRJUguGKUmSpBYMU5IkSS38f7wWpOhU72wgAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制性别与生还的关系图\n",
    "fig,axes = plt.subplots(1,2,figsize=(10,5))\n",
    "train_data[['Sex','Survived']].groupby(['Sex']).mean().plot.bar(ax=axes[0])\n",
    "pd.crosstab(train_data.Sex,train_data.Survived).plot.bar(stacked=True,ax=axes[1])\n",
    "\n",
    "# 由图可看出，女士生存几率远高于男士，体现了女士优先的精神"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1e2aff15850>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq/5QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deXhU1fnA8e+ZyWRmsq+sAcIqgiwKuKAgiqIgUrUCUgUttLi2WLsoKmpbt6rVamsXKyoqvwKKyqKyb6Kyg7IvIQQSwpaQkHXW8/sjCSIECGQmd2bu+3kenmRm7tz7Drnzzplzz3mP0lojhBDCPCxGByCEEKJhSeIXQgiTkcQvhBAmI4lfCCFMRhK/EEKYTJTRAdRFWlqazszMNDoMIYQIK2vXrj2itU4/+f6wSPyZmZmsWbPG6DCEECKsKKVyartfunqEEMJkJPELIYTJSOIXQgiTCYs+fiGECDSPx0Nubi6VlZVGh1JvDoeDjIwMbDZbnbaXxC+EMKXc3Fzi4+PJzMxEKWV0OOdNa01B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Wl9Ry+MWqr4NtAYGaa2/b+AQhTgr6eMX4gyUUhdUr2FQoztV6xOkV1/4RSllU0p1rn78N9WPjwDeqa4uKURIkRa/EGdQ3c3zd6oWBPECu4CxQAbwBlXlrqOAv1HV0p8BXKq1LlFKvQqUaK2fNiJ2IU5HEr8QQpiMdPUIIYTJSOIXQgiTkcQvhBAmI4lfCCFMRhK/EEKYjCR+IYQwGUn8QghhMv8Pi+uNoDqfcRMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制年龄、性别与生还的关系图\n",
    "#由于年龄有缺失值，先用年龄的中位数填补\n",
    "train_data['Age']=train_data['Age'].fillna(train_data['Age'].median())\n",
    "sns.violinplot(x='Sex', y='Age', hue='Survived', data=train_data, split=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1e2b35ae4f0>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEICAYAAACwDehOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deZyT9bn//9eVZPZ9hYFhdVgEQVTcv21xabVUsZsCtSrVlnNOsYd6bOtWl/4qLrW1p0etLa1WzhFFcAGlVUtRcBcGVGSHYZ1hmJXZ1yTX749k4ggDMyOTZcj1fDzySHLnvpMrhMk7n/tzfz63qCrGGGMMgCPcBRhjjIkcFgrGGGMCLBSMMcYEWCgYY4wJsFAwxhgTYKFgjDEmIKihICLpIvK8i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F5BPhAVReKSCzgVNXmsLxhE/WspWDMsSX4p1EuBPbhm9foQuB5Va0EUNWuzn1xioi87Q+Bq4Hx/uXvAk+JyI8Ap3/Z+8DtInILMMwCwYSTK9wFGBPhmv3TKAf4J73rron9FL4zrn0iIrOAKQCq+u8icjbwDeBjEZmkqs+IyIf+Za+LyA9V9Y0+fh/G9Ii1FIzpvZXAVSKSBSAimV2skwKU+qfRvrpjoYicpKofqupdQCUwRERGArtU9X+Al4GJQX8HxhyFtRSM6SVV3SQi84DVIuIBPgJmHbbanfjOuLYX+BRfSAA85O9IFnzh8glwK/B9EWkHDgL/X9DfhDFHYR3NxhhjAmz3kTHGmAALBWOMMQEWCsYYYwIsFIwxxgRYKBhjjAmwUDDGGBNgoWCMMSbAQsEYY0zA/w9poCYyXywN1wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 船舱等级、价格与生还关系分析\n",
    "sns.violinplot(x='Pclass', y='Fare', hue='Survived', data=train_data, split=True)\n",
    "\n",
    "# 上图可看出，在票价高的高级舱存活概率大很多"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 特征工程\n",
    "### 数据预处理\n",
    "\n",
    "缺失值处理\n",
    "\n",
    "很多机器学习算法为了训练模型，要求所传入的特征中不能有空值，在训练模型前需要对数据的缺失值进行处理，处理的方法一般有下列几种方法：\n",
    "\n",
    "* 如果数据量很大，但缺失值很少，可以删掉带缺失值的行\n",
    "* 如果是数值类型，且缺失值不是很多，可以用平均值、中位数，众数来填充\n",
    "* 如果是分类数据，用最常见的类别取代\n",
    "* 使用模型预测缺失值，例如：K-NN\n",
    "\n",
    "当然最重要的还是对业务的理解，方法只是有指导意义，具体还是要具体业务具体分析，采取合理的方法进行缺失值处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "合并后的数据集: (1309, 12)\n"
     ]
    }
   ],
   "source": [
    "#训练集\n",
    "train_data = pd.read_csv('data/train.csv')\n",
    "#测试集\n",
    "test_data = pd.read_csv('data/test.csv')\n",
    "#合并数据集，方便同时对两个数据集进行清洗\n",
    "full_data = pd.concat( [train_data,test_data] , ignore_index = True )\n",
    "\n",
    "print ('合并后的数据集:',full_data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       U\n",
       "1     C85\n",
       "2       U\n",
       "3    C123\n",
       "4       U\n",
       "Name: Cabin, dtype: object"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 船舱号（Cabin）里面数据总数是295，缺失了1309-295=1014，缺失率=1014/1309=77.5%，缺失比较大，用'U'填充代表未知\n",
    "\n",
    "full_data['Cabin'].fillna('U',inplace=True)\n",
    "full_data['Cabin'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "#只保留取船舱的首字母，只要了解具体的船舱就可以，具体的位置就不管了\n",
    "full_data['Cabin']=full_data['Cabin'].apply(lambda x:x[0])\n",
    "\n",
    "#多出的一个舱位T，票价也不贵，把它划到G\n",
    "full_data['Cabin'].loc[full_data['Cabin']=='T']='G'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 登船港口有两个缺失值，所以我直接填充为出现数量最多的港口\n",
    "full_data['Embarked']=full_data['Embarked'].fillna(full_data['Embarked'].mode().values[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "#票价有一个缺失值，用票价的中位数填充\n",
    "full_data['Fare']=full_data['Fare'].fillna(full_data['Fare'].median())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "#名字里有Mr、Miss、Mrs字样，将其提取出来\n",
    "full_data['Title']=full_data['Name'].apply(lambda x: x.split(',')[1].split('.')[0].strip())\n",
    "'''\n",
    "定义以下几种头衔类别：\n",
    "Officer政府官员\n",
    "Royalty王室（皇室）\n",
    "Mr已婚男士\n",
    "Mrs已婚妇女\n",
    "Miss年轻未婚女子\n",
    "Master有技能的人/教师\n",
    "'''\n",
    "#姓名中头衔字符串与定义头衔类别的映射关系\n",
    "title_mapDict = {\n",
    "                    \"Capt\":       \"Officer\",\n",
    "                    \"Col\":        \"Officer\",\n",
    "                    \"Major\":      \"Officer\",\n",
    "                    \"Jonkheer\":   \"Royalty\",\n",
    "                    \"Don\":        \"Royalty\",\n",
    "                    \"Sir\" :       \"Royalty\",\n",
    "                    \"Dr\":         \"Officer\",\n",
    "                    \"Rev\":        \"Officer\",\n",
    "                    \"the Countess\":\"Royalty\",\n",
    "                    \"Dona\":       \"Royalty\",\n",
    "                    \"Mme\":        \"Mrs\",\n",
    "                    \"Mlle\":       \"Miss\",\n",
    "                    \"Ms\":         \"Mrs\",\n",
    "                    \"Mr\" :        \"Mr\",\n",
    "                    \"Mrs\" :       \"Mrs\",\n",
    "                    \"Miss\" :      \"Miss\",\n",
    "                    \"Master\" :    \"Master\",\n",
    "                    \"Lady\" :      \"Royalty\"\n",
    "                    }\n",
    "\n",
    "full_data['Title'] = full_data['Title'].map(title_mapDict) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "#填充年龄，采用不同称呼的乘客年龄的中位数来填充\n",
    "age_median=full_data.groupby('Title')['Age'].median()\n",
    "def fillage (cols):\n",
    "    age=cols[0]\n",
    "    title=cols[1]\n",
    "    if pd.isnull(age):\n",
    "        return age_median[title]\n",
    "    return age\n",
    "full_data['Age']=full_data[['Age','Title']].apply(fillage,axis=1)   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 特征提取\n",
    "数据分类\n",
    "\n",
    "查看数据类型，分为3种数据类型。并对类别数据处理：用数值代替类别，并进行One-hot编码\n",
    "\n",
    "1.定性(Quantitative)变量可以以某种方式排序，Age就是一个很好的列子。\n",
    "\n",
    "2.定量(Qualitative)变量描述了物体的某一（不能被数学表示的）方面，Embarked就是一个例子。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1309 entries, 0 to 1308\n",
      "Data columns (total 13 columns):\n",
      " #   Column       Non-Null Count  Dtype  \n",
      "---  ------       --------------  -----  \n",
      " 0   PassengerId  1309 non-null   int64  \n",
      " 1   Survived     891 non-null    float64\n",
      " 2   Pclass       1309 non-null   int64  \n",
      " 3   Name         1309 non-null   object \n",
      " 4   Sex          1309 non-null   object \n",
      " 5   Age          1309 non-null   float64\n",
      " 6   SibSp        1309 non-null   int64  \n",
      " 7   Parch        1309 non-null   int64  \n",
      " 8   Ticket       1309 non-null   object \n",
      " 9   Fare         1309 non-null   float64\n",
      " 10  Cabin        1309 non-null   object \n",
      " 11  Embarked     1309 non-null   object \n",
      " 12  Title        1309 non-null   object \n",
      "dtypes: float64(3), int64(4), object(6)\n",
      "memory usage: 133.1+ KB\n"
     ]
    }
   ],
   "source": [
    "full_data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      male\n",
       "1    female\n",
       "2    female\n",
       "3    female\n",
       "4      male\n",
       "Name: Sex, dtype: object"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#查看性别数据这一列\n",
    "full_data['Sex'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "sex_mapDict={'male':1,\n",
    "            'female':0}\n",
    "#map函数：对Series每个数据应用自定义的函数计算\n",
    "full_data['Sex']=full_data['Sex'].map(sex_mapDict)   "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Embarked_C</th>\n",
       "      <th>Embarked_Q</th>\n",
       "      <th>Embarked_S</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Embarked_C  Embarked_Q  Embarked_S\n",
       "0           0           0           1\n",
       "1           1           0           0\n",
       "2           0           0           1\n",
       "3           0           0           1\n",
       "4           0           0           1"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "embarkedDf = pd.get_dummies( full_data['Embarked'] , prefix='Embarked' )\n",
    "embarkedDf.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加one-hot编码产生的虚拟变量（dummy variables）到泰坦尼克号数据集full\n",
    "full_data = pd.concat([full_data,embarkedDf],axis=1)\n",
    "\n",
    "'''\n",
    "因为已经使用登船港口(Embarked)进行了one-hot编码产生了它的虚拟变量（dummy variables）\n",
    "所以这里把登船港口(Embarked)删掉\n",
    "'''\n",
    "full_data.drop('Embarked',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pclass_1</th>\n",
       "      <th>Pclass_2</th>\n",
       "      <th>Pclass_3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pclass_1  Pclass_2  Pclass_3\n",
       "0         0         0         1\n",
       "1         1         0         0\n",
       "2         0         0         1\n",
       "3         1         0         0\n",
       "4         0         0         1"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#使用get_dummies进行one-hot编码，列名前缀是Pclass\n",
    "pclassDf = pd.get_dummies( full_data['Pclass'] , prefix='Pclass' )\n",
    "pclassDf.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加one-hot编码产生的虚拟变量（dummy variables）到泰坦尼克号数据集full_data\n",
    "full_data = pd.concat([full_data,pclassDf],axis=1)\n",
    "\n",
    "#删掉客舱等级（Pclass）这一列\n",
    "full_data.drop('Pclass',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加one-hot编码产生的虚拟变量（dummy variables）到泰坦尼克号数据集full_data\n",
    "titleDf = pd.get_dummies( full_data['Title'] , prefix='Pclass' )\n",
    "full_data = pd.concat([full_data,titleDf],axis=1)\n",
    "\n",
    "#删掉姓名这一列\n",
    "full_data.drop(['Name','Title'],axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Cabin_A</th>\n",
       "      <th>Cabin_B</th>\n",
       "      <th>Cabin_C</th>\n",
       "      <th>Cabin_D</th>\n",
       "      <th>Cabin_E</th>\n",
       "      <th>Cabin_F</th>\n",
       "      <th>Cabin_G</th>\n",
       "      <th>Cabin_U</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Cabin_A  Cabin_B  Cabin_C  Cabin_D  Cabin_E  Cabin_F  Cabin_G  Cabin_U\n",
       "0        0        0        0        0        0        0        0        1\n",
       "1        0        0        1        0        0        0        0        0\n",
       "2        0        0        0        0        0        0        0        1\n",
       "3        0        0        1        0        0        0        0        0\n",
       "4        0        0        0        0        0        0        0        1"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "客场号的类别值是首字母，例如：\n",
    "C85 类别映射为首字母C\n",
    "'''\n",
    "\n",
    "# 使用get_dummies进行one-hot编码，列名前缀是Cabin\n",
    "cabinDf = pd.get_dummies( full_data['Cabin'] , prefix = 'Cabin' )\n",
    "\n",
    "cabinDf.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "#添加one-hot编码产生的虚拟变量（dummy variables）到泰坦尼克号数据集full_data\n",
    "full_data = pd.concat([full_data,cabinDf],axis=1)\n",
    "\n",
    "#删掉客舱号这一列\n",
    "full_data.drop('Cabin',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>FamilySize</th>\n",
       "      <th>Family_Single</th>\n",
       "      <th>Family_Small</th>\n",
       "      <th>Family_Large</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   FamilySize  Family_Single  Family_Small  Family_Large\n",
       "0           2              0             1             0\n",
       "1           2              0             1             0\n",
       "2           1              1             0             0\n",
       "3           2              0             1             0\n",
       "4           1              1             0             0"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "familyDf=pd.DataFrame()\n",
    "'''\n",
    "家庭人数=同代直系亲属数（Parch）+不同代直系亲属数（SibSp）+乘客自己\n",
    "（因为乘客自己也是家庭成员的一个，所以这里加1）\n",
    "'''\n",
    "familyDf[ 'FamilySize' ] = full_data[ 'Parch' ] + full_data[ 'SibSp' ] + 1\n",
    "\n",
    "'''\n",
    "家庭类别：\n",
    "小家庭Family_Single：家庭人数=1\n",
    "中等家庭Family_Small: 2<=家庭人数<=4\n",
    "大家庭Family_Large: 家庭人数>=5\n",
    "'''\n",
    "#if 条件为真的时候返回if前面内容，否则返回0\n",
    "familyDf[ 'Family_Single' ] = familyDf[ 'FamilySize' ].map( lambda s : 1 if s == 1 else 0 )\n",
    "familyDf[ 'Family_Small' ]  = familyDf[ 'FamilySize' ].map( lambda s : 1 if 2 <= s <= 4 else 0 )\n",
    "familyDf[ 'Family_Large' ]  = familyDf[ 'FamilySize' ].map( lambda s : 1 if 5 <= s else 0 )\n",
    "\n",
    "familyDf.head() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1309, 32)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#添加one-hot编码产生的虚拟变量（dummy variables）到泰坦尼克号数据集full_data\n",
    "full_data = pd.concat([full_data,familyDf],axis=1)\n",
    "\n",
    " #到现在我们已经有了这么多个特征了\n",
    "full_data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Embarked_C</th>\n",
       "      <th>Embarked_Q</th>\n",
       "      <th>Embarked_S</th>\n",
       "      <th>...</th>\n",
       "      <th>Cabin_C</th>\n",
       "      <th>Cabin_D</th>\n",
       "      <th>Cabin_E</th>\n",
       "      <th>Cabin_F</th>\n",
       "      <th>Cabin_G</th>\n",
       "      <th>Cabin_U</th>\n",
       "      <th>FamilySize</th>\n",
       "      <th>Family_Single</th>\n",
       "      <th>Family_Small</th>\n",
       "      <th>Family_Large</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>PassengerId</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.005007</td>\n",
       "      <td>0.013406</td>\n",
       "      <td>0.025161</td>\n",
       "      <td>-0.055224</td>\n",
       "      <td>0.008942</td>\n",
       "      <td>0.031128</td>\n",
       "      <td>0.048101</td>\n",
       "      <td>0.011585</td>\n",
       "      <td>-0.049836</td>\n",
       "      <td>...</td>\n",
       "      <td>0.006092</td>\n",
       "      <td>0.000549</td>\n",
       "      <td>-0.008136</td>\n",
       "      <td>0.000306</td>\n",
       "      <td>-0.051389</td>\n",
       "      <td>0.000208</td>\n",
       "      <td>-0.031437</td>\n",
       "      <td>0.028546</td>\n",
       "      <td>0.002975</td>\n",
       "      <td>-0.063415</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Survived</th>\n",
       "      <td>-0.005007</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.543351</td>\n",
       "      <td>-0.072174</td>\n",
       "      <td>-0.035322</td>\n",
       "      <td>0.081629</td>\n",
       "      <td>0.257307</td>\n",
       "      <td>0.168240</td>\n",
       "      <td>0.003650</td>\n",
       "      <td>-0.149683</td>\n",
       "      <td>...</td>\n",
       "      <td>0.114652</td>\n",
       "      <td>0.150716</td>\n",
       "      <td>0.145321</td>\n",
       "      <td>0.057935</td>\n",
       "      <td>0.002496</td>\n",
       "      <td>-0.316912</td>\n",
       "      <td>0.016639</td>\n",
       "      <td>-0.203367</td>\n",
       "      <td>0.279855</td>\n",
       "      <td>-0.125147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Sex</th>\n",
       "      <td>0.013406</td>\n",
       "      <td>-0.543351</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.060982</td>\n",
       "      <td>-0.109609</td>\n",
       "      <td>-0.213125</td>\n",
       "      <td>-0.185681</td>\n",
       "      <td>-0.066564</td>\n",
       "      <td>-0.088651</td>\n",
       "      <td>0.115193</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.077473</td>\n",
       "      <td>-0.057396</td>\n",
       "      <td>-0.040340</td>\n",
       "      <td>-0.006655</td>\n",
       "      <td>-0.067649</td>\n",
       "      <td>0.137396</td>\n",
       "      <td>-0.188583</td>\n",
       "      <td>0.284537</td>\n",
       "      <td>-0.255196</td>\n",
       "      <td>-0.077748</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Age</th>\n",
       "      <td>0.025161</td>\n",
       "      <td>-0.072174</td>\n",
       "      <td>0.060982</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.214720</td>\n",
       "      <td>-0.130326</td>\n",
       "      <td>0.179594</td>\n",
       "      <td>0.080710</td>\n",
       "      <td>-0.059136</td>\n",
       "      <td>-0.033604</td>\n",
       "      <td>...</td>\n",
       "      <td>0.175148</td>\n",
       "      <td>0.137439</td>\n",
       "      <td>0.109333</td>\n",
       "      <td>-0.071171</td>\n",
       "      <td>-0.061526</td>\n",
       "      <td>-0.284174</td>\n",
       "      <td>-0.212466</td>\n",
       "      <td>0.114964</td>\n",
       "      <td>-0.030395</td>\n",
       "      <td>-0.172922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SibSp</th>\n",
       "      <td>-0.055224</td>\n",
       "      <td>-0.035322</td>\n",
       "      <td>-0.109609</td>\n",
       "      <td>-0.214720</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.373587</td>\n",
       "      <td>0.160349</td>\n",
       "      <td>-0.048396</td>\n",
       "      <td>-0.048678</td>\n",
       "      <td>0.073709</td>\n",
       "      <td>...</td>\n",
       "      <td>0.048616</td>\n",
       "      <td>-0.015727</td>\n",
       "      <td>-0.027180</td>\n",
       "      <td>-0.008619</td>\n",
       "      <td>0.000075</td>\n",
       "      <td>0.009064</td>\n",
       "      <td>0.861952</td>\n",
       "      <td>-0.591077</td>\n",
       "      <td>0.253590</td>\n",
       "      <td>0.699681</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Parch</th>\n",
       "      <td>0.008942</td>\n",
       "      <td>0.081629</td>\n",
       "      <td>-0.213125</td>\n",
       "      <td>-0.130326</td>\n",
       "      <td>0.373587</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.221635</td>\n",
       "      <td>-0.008635</td>\n",
       "      <td>-0.100943</td>\n",
       "      <td>0.071881</td>\n",
       "      <td>...</td>\n",
       "      <td>0.009601</td>\n",
       "      <td>-0.027385</td>\n",
       "      <td>0.001084</td>\n",
       "      <td>0.020481</td>\n",
       "      <td>0.048231</td>\n",
       "      <td>-0.036806</td>\n",
       "      <td>0.792296</td>\n",
       "      <td>-0.549022</td>\n",
       "      <td>0.248532</td>\n",
       "      <td>0.624627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Fare</th>\n",
       "      <td>0.031128</td>\n",
       "      <td>0.257307</td>\n",
       "      <td>-0.185681</td>\n",
       "      <td>0.179594</td>\n",
       "      <td>0.160349</td>\n",
       "      <td>0.221635</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.286368</td>\n",
       "      <td>-0.129958</td>\n",
       "      <td>-0.170068</td>\n",
       "      <td>...</td>\n",
       "      <td>0.401427</td>\n",
       "      <td>0.072786</td>\n",
       "      <td>0.073995</td>\n",
       "      <td>-0.037529</td>\n",
       "      <td>-0.020371</td>\n",
       "      <td>-0.507321</td>\n",
       "      <td>0.226609</td>\n",
       "      <td>-0.275037</td>\n",
       "      <td>0.197468</td>\n",
       "      <td>0.170916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Embarked_C</th>\n",
       "      <td>0.048101</td>\n",
       "      <td>0.168240</td>\n",
       "      <td>-0.066564</td>\n",
       "      <td>0.080710</td>\n",
       "      <td>-0.048396</td>\n",
       "      <td>-0.008635</td>\n",
       "      <td>0.286368</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.164166</td>\n",
       "      <td>-0.778262</td>\n",
       "      <td>...</td>\n",
       "      <td>0.158043</td>\n",
       "      <td>0.107782</td>\n",
       "      <td>0.027566</td>\n",
       "      <td>-0.020010</td>\n",
       "      <td>-0.034592</td>\n",
       "      <td>-0.258257</td>\n",
       "      <td>-0.036553</td>\n",
       "      <td>-0.107874</td>\n",
       "      <td>0.159594</td>\n",
       "      <td>-0.092825</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Embarked_Q</th>\n",
       "      <td>0.011585</td>\n",
       "      <td>0.003650</td>\n",
       "      <td>-0.088651</td>\n",
       "      <td>-0.059136</td>\n",
       "      <td>-0.048678</td>\n",
       "      <td>-0.100943</td>\n",
       "      <td>-0.129958</td>\n",
       "      <td>-0.164166</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.491656</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.059151</td>\n",
       "      <td>-0.061459</td>\n",
       "      <td>-0.042877</td>\n",
       "      <td>-0.020282</td>\n",
       "      <td>-0.021853</td>\n",
       "      <td>0.142369</td>\n",
       "      <td>-0.087190</td>\n",
       "      <td>0.127214</td>\n",
       "      <td>-0.122491</td>\n",
       "      <td>-0.018423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Embarked_S</th>\n",
       "      <td>-0.049836</td>\n",
       "      <td>-0.149683</td>\n",
       "      <td>0.115193</td>\n",
       "      <td>-0.033604</td>\n",
       "      <td>0.073709</td>\n",
       "      <td>0.071881</td>\n",
       "      <td>-0.170068</td>\n",
       "      <td>-0.778262</td>\n",
       "      <td>-0.491656</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.101861</td>\n",
       "      <td>-0.056023</td>\n",
       "      <td>0.002960</td>\n",
       "      <td>0.030575</td>\n",
       "      <td>0.044448</td>\n",
       "      <td>0.137351</td>\n",
       "      <td>0.087771</td>\n",
       "      <td>0.014246</td>\n",
       "      <td>-0.062909</td>\n",
       "      <td>0.093671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_1</th>\n",
       "      <td>0.026495</td>\n",
       "      <td>0.285904</td>\n",
       "      <td>-0.107371</td>\n",
       "      <td>0.379932</td>\n",
       "      <td>-0.034256</td>\n",
       "      <td>-0.013033</td>\n",
       "      <td>0.600085</td>\n",
       "      <td>0.325722</td>\n",
       "      <td>-0.166101</td>\n",
       "      <td>-0.181800</td>\n",
       "      <td>...</td>\n",
       "      <td>0.485974</td>\n",
       "      <td>0.275698</td>\n",
       "      <td>0.242963</td>\n",
       "      <td>-0.073083</td>\n",
       "      <td>-0.012606</td>\n",
       "      <td>-0.776987</td>\n",
       "      <td>-0.029656</td>\n",
       "      <td>-0.126551</td>\n",
       "      <td>0.165965</td>\n",
       "      <td>-0.067523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_2</th>\n",
       "      <td>0.022714</td>\n",
       "      <td>0.093349</td>\n",
       "      <td>-0.028862</td>\n",
       "      <td>0.000812</td>\n",
       "      <td>-0.052419</td>\n",
       "      <td>-0.010057</td>\n",
       "      <td>-0.121222</td>\n",
       "      <td>-0.134675</td>\n",
       "      <td>-0.121973</td>\n",
       "      <td>0.196532</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.144104</td>\n",
       "      <td>-0.037929</td>\n",
       "      <td>-0.050210</td>\n",
       "      <td>0.127371</td>\n",
       "      <td>-0.035156</td>\n",
       "      <td>0.176485</td>\n",
       "      <td>-0.039976</td>\n",
       "      <td>-0.035075</td>\n",
       "      <td>0.097270</td>\n",
       "      <td>-0.118495</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_3</th>\n",
       "      <td>-0.041544</td>\n",
       "      <td>-0.322308</td>\n",
       "      <td>0.116562</td>\n",
       "      <td>-0.329402</td>\n",
       "      <td>0.072610</td>\n",
       "      <td>0.019521</td>\n",
       "      <td>-0.419851</td>\n",
       "      <td>-0.171430</td>\n",
       "      <td>0.243706</td>\n",
       "      <td>-0.003805</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.302359</td>\n",
       "      <td>-0.207455</td>\n",
       "      <td>-0.169063</td>\n",
       "      <td>-0.041178</td>\n",
       "      <td>0.039726</td>\n",
       "      <td>0.527614</td>\n",
       "      <td>0.058430</td>\n",
       "      <td>0.138250</td>\n",
       "      <td>-0.223338</td>\n",
       "      <td>0.155560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Master</th>\n",
       "      <td>0.002254</td>\n",
       "      <td>0.085221</td>\n",
       "      <td>0.164375</td>\n",
       "      <td>-0.405676</td>\n",
       "      <td>0.329171</td>\n",
       "      <td>0.253482</td>\n",
       "      <td>0.011657</td>\n",
       "      <td>-0.014172</td>\n",
       "      <td>-0.009091</td>\n",
       "      <td>0.018297</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.047456</td>\n",
       "      <td>-0.042192</td>\n",
       "      <td>0.001860</td>\n",
       "      <td>0.058311</td>\n",
       "      <td>-0.015002</td>\n",
       "      <td>0.041178</td>\n",
       "      <td>0.355061</td>\n",
       "      <td>-0.265355</td>\n",
       "      <td>0.120166</td>\n",
       "      <td>0.301809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Miss</th>\n",
       "      <td>-0.050027</td>\n",
       "      <td>0.332795</td>\n",
       "      <td>-0.672819</td>\n",
       "      <td>-0.288746</td>\n",
       "      <td>0.077564</td>\n",
       "      <td>0.066473</td>\n",
       "      <td>0.092185</td>\n",
       "      <td>-0.014351</td>\n",
       "      <td>0.198804</td>\n",
       "      <td>-0.113886</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.013418</td>\n",
       "      <td>-0.012516</td>\n",
       "      <td>0.008700</td>\n",
       "      <td>-0.003088</td>\n",
       "      <td>0.050853</td>\n",
       "      <td>-0.004364</td>\n",
       "      <td>0.087350</td>\n",
       "      <td>-0.023890</td>\n",
       "      <td>-0.018085</td>\n",
       "      <td>0.083422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Mr</th>\n",
       "      <td>0.014116</td>\n",
       "      <td>-0.549199</td>\n",
       "      <td>0.870678</td>\n",
       "      <td>0.184094</td>\n",
       "      <td>-0.243104</td>\n",
       "      <td>-0.304780</td>\n",
       "      <td>-0.192420</td>\n",
       "      <td>-0.065538</td>\n",
       "      <td>-0.080224</td>\n",
       "      <td>0.108924</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.068072</td>\n",
       "      <td>-0.030261</td>\n",
       "      <td>-0.032953</td>\n",
       "      <td>-0.026403</td>\n",
       "      <td>-0.056564</td>\n",
       "      <td>0.131807</td>\n",
       "      <td>-0.326487</td>\n",
       "      <td>0.386262</td>\n",
       "      <td>-0.300872</td>\n",
       "      <td>-0.194207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Mrs</th>\n",
       "      <td>0.033299</td>\n",
       "      <td>0.344935</td>\n",
       "      <td>-0.571176</td>\n",
       "      <td>0.231678</td>\n",
       "      <td>0.061643</td>\n",
       "      <td>0.213491</td>\n",
       "      <td>0.139346</td>\n",
       "      <td>0.098379</td>\n",
       "      <td>-0.100374</td>\n",
       "      <td>-0.022950</td>\n",
       "      <td>...</td>\n",
       "      <td>0.112164</td>\n",
       "      <td>0.080393</td>\n",
       "      <td>0.045538</td>\n",
       "      <td>0.013376</td>\n",
       "      <td>0.034052</td>\n",
       "      <td>-0.162253</td>\n",
       "      <td>0.157233</td>\n",
       "      <td>-0.354649</td>\n",
       "      <td>0.361247</td>\n",
       "      <td>0.012893</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Officer</th>\n",
       "      <td>0.002231</td>\n",
       "      <td>-0.031316</td>\n",
       "      <td>0.087288</td>\n",
       "      <td>0.172664</td>\n",
       "      <td>-0.013813</td>\n",
       "      <td>-0.032631</td>\n",
       "      <td>0.028731</td>\n",
       "      <td>0.003678</td>\n",
       "      <td>-0.003212</td>\n",
       "      <td>-0.001202</td>\n",
       "      <td>...</td>\n",
       "      <td>0.052889</td>\n",
       "      <td>0.006055</td>\n",
       "      <td>-0.024048</td>\n",
       "      <td>-0.017076</td>\n",
       "      <td>-0.009075</td>\n",
       "      <td>-0.067030</td>\n",
       "      <td>-0.026921</td>\n",
       "      <td>0.013303</td>\n",
       "      <td>0.003966</td>\n",
       "      <td>-0.034572</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pclass_Royalty</th>\n",
       "      <td>0.004400</td>\n",
       "      <td>0.033391</td>\n",
       "      <td>-0.020408</td>\n",
       "      <td>0.060550</td>\n",
       "      <td>-0.010787</td>\n",
       "      <td>-0.030197</td>\n",
       "      <td>0.026232</td>\n",
       "      <td>0.077213</td>\n",
       "      <td>-0.021853</td>\n",
       "      <td>-0.054250</td>\n",
       "      <td>...</td>\n",
       "      <td>0.024932</td>\n",
       "      <td>-0.012950</td>\n",
       "      <td>-0.012202</td>\n",
       "      <td>-0.008665</td>\n",
       "      <td>-0.004605</td>\n",
       "      <td>-0.071672</td>\n",
       "      <td>-0.023600</td>\n",
       "      <td>0.008761</td>\n",
       "      <td>-0.000073</td>\n",
       "      <td>-0.017542</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_A</th>\n",
       "      <td>-0.002831</td>\n",
       "      <td>0.022287</td>\n",
       "      <td>0.047561</td>\n",
       "      <td>0.125848</td>\n",
       "      <td>-0.039808</td>\n",
       "      <td>-0.030707</td>\n",
       "      <td>0.020130</td>\n",
       "      <td>0.094914</td>\n",
       "      <td>-0.042105</td>\n",
       "      <td>-0.056984</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.036366</td>\n",
       "      <td>-0.024952</td>\n",
       "      <td>-0.023510</td>\n",
       "      <td>-0.016695</td>\n",
       "      <td>-0.008872</td>\n",
       "      <td>-0.242399</td>\n",
       "      <td>-0.042967</td>\n",
       "      <td>0.045227</td>\n",
       "      <td>-0.029546</td>\n",
       "      <td>-0.033799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_B</th>\n",
       "      <td>0.015895</td>\n",
       "      <td>0.175095</td>\n",
       "      <td>-0.094453</td>\n",
       "      <td>0.120073</td>\n",
       "      <td>-0.011569</td>\n",
       "      <td>0.073051</td>\n",
       "      <td>0.393787</td>\n",
       "      <td>0.161595</td>\n",
       "      <td>-0.073613</td>\n",
       "      <td>-0.095790</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.063580</td>\n",
       "      <td>-0.043624</td>\n",
       "      <td>-0.041103</td>\n",
       "      <td>-0.029188</td>\n",
       "      <td>-0.015511</td>\n",
       "      <td>-0.423794</td>\n",
       "      <td>0.032318</td>\n",
       "      <td>-0.087912</td>\n",
       "      <td>0.084268</td>\n",
       "      <td>0.013470</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_C</th>\n",
       "      <td>0.006092</td>\n",
       "      <td>0.114652</td>\n",
       "      <td>-0.077473</td>\n",
       "      <td>0.175148</td>\n",
       "      <td>0.048616</td>\n",
       "      <td>0.009601</td>\n",
       "      <td>0.401427</td>\n",
       "      <td>0.158043</td>\n",
       "      <td>-0.059151</td>\n",
       "      <td>-0.101861</td>\n",
       "      <td>...</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.053083</td>\n",
       "      <td>-0.050016</td>\n",
       "      <td>-0.035516</td>\n",
       "      <td>-0.018875</td>\n",
       "      <td>-0.515684</td>\n",
       "      <td>0.037226</td>\n",
       "      <td>-0.137498</td>\n",
       "      <td>0.141925</td>\n",
       "      <td>0.001362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_D</th>\n",
       "      <td>0.000549</td>\n",
       "      <td>0.150716</td>\n",
       "      <td>-0.057396</td>\n",
       "      <td>0.137439</td>\n",
       "      <td>-0.015727</td>\n",
       "      <td>-0.027385</td>\n",
       "      <td>0.072786</td>\n",
       "      <td>0.107782</td>\n",
       "      <td>-0.061459</td>\n",
       "      <td>-0.056023</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.053083</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.034317</td>\n",
       "      <td>-0.024369</td>\n",
       "      <td>-0.012950</td>\n",
       "      <td>-0.353822</td>\n",
       "      <td>-0.025313</td>\n",
       "      <td>-0.074310</td>\n",
       "      <td>0.102432</td>\n",
       "      <td>-0.049336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_E</th>\n",
       "      <td>-0.008136</td>\n",
       "      <td>0.145321</td>\n",
       "      <td>-0.040340</td>\n",
       "      <td>0.109333</td>\n",
       "      <td>-0.027180</td>\n",
       "      <td>0.001084</td>\n",
       "      <td>0.073995</td>\n",
       "      <td>0.027566</td>\n",
       "      <td>-0.042877</td>\n",
       "      <td>0.002960</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.050016</td>\n",
       "      <td>-0.034317</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.022961</td>\n",
       "      <td>-0.012202</td>\n",
       "      <td>-0.333381</td>\n",
       "      <td>-0.017285</td>\n",
       "      <td>-0.042535</td>\n",
       "      <td>0.068007</td>\n",
       "      <td>-0.046485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_F</th>\n",
       "      <td>0.000306</td>\n",
       "      <td>0.057935</td>\n",
       "      <td>-0.006655</td>\n",
       "      <td>-0.071171</td>\n",
       "      <td>-0.008619</td>\n",
       "      <td>0.020481</td>\n",
       "      <td>-0.037529</td>\n",
       "      <td>-0.020010</td>\n",
       "      <td>-0.020282</td>\n",
       "      <td>0.030575</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.035516</td>\n",
       "      <td>-0.024369</td>\n",
       "      <td>-0.022961</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.008665</td>\n",
       "      <td>-0.236733</td>\n",
       "      <td>0.005525</td>\n",
       "      <td>0.004055</td>\n",
       "      <td>0.012756</td>\n",
       "      <td>-0.033009</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_G</th>\n",
       "      <td>-0.051389</td>\n",
       "      <td>0.002496</td>\n",
       "      <td>-0.067649</td>\n",
       "      <td>-0.061526</td>\n",
       "      <td>0.000075</td>\n",
       "      <td>0.048231</td>\n",
       "      <td>-0.020371</td>\n",
       "      <td>-0.034592</td>\n",
       "      <td>-0.021853</td>\n",
       "      <td>0.044448</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.018875</td>\n",
       "      <td>-0.012950</td>\n",
       "      <td>-0.012202</td>\n",
       "      <td>-0.008665</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.125809</td>\n",
       "      <td>0.026411</td>\n",
       "      <td>-0.060600</td>\n",
       "      <td>0.071874</td>\n",
       "      <td>-0.017542</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Cabin_U</th>\n",
       "      <td>0.000208</td>\n",
       "      <td>-0.316912</td>\n",
       "      <td>0.137396</td>\n",
       "      <td>-0.284174</td>\n",
       "      <td>0.009064</td>\n",
       "      <td>-0.036806</td>\n",
       "      <td>-0.507321</td>\n",
       "      <td>-0.258257</td>\n",
       "      <td>0.142369</td>\n",
       "      <td>0.137351</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.515684</td>\n",
       "      <td>-0.353822</td>\n",
       "      <td>-0.333381</td>\n",
       "      <td>-0.236733</td>\n",
       "      <td>-0.125809</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.014155</td>\n",
       "      <td>0.175812</td>\n",
       "      <td>-0.211367</td>\n",
       "      <td>0.056438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FamilySize</th>\n",
       "      <td>-0.031437</td>\n",
       "      <td>0.016639</td>\n",
       "      <td>-0.188583</td>\n",
       "      <td>-0.212466</td>\n",
       "      <td>0.861952</td>\n",
       "      <td>0.792296</td>\n",
       "      <td>0.226609</td>\n",
       "      <td>-0.036553</td>\n",
       "      <td>-0.087190</td>\n",
       "      <td>0.087771</td>\n",
       "      <td>...</td>\n",
       "      <td>0.037226</td>\n",
       "      <td>-0.025313</td>\n",
       "      <td>-0.017285</td>\n",
       "      <td>0.005525</td>\n",
       "      <td>0.026411</td>\n",
       "      <td>-0.014155</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.688864</td>\n",
       "      <td>0.302640</td>\n",
       "      <td>0.801623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Family_Single</th>\n",
       "      <td>0.028546</td>\n",
       "      <td>-0.203367</td>\n",
       "      <td>0.284537</td>\n",
       "      <td>0.114964</td>\n",
       "      <td>-0.591077</td>\n",
       "      <td>-0.549022</td>\n",
       "      <td>-0.275037</td>\n",
       "      <td>-0.107874</td>\n",
       "      <td>0.127214</td>\n",
       "      <td>0.014246</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.137498</td>\n",
       "      <td>-0.074310</td>\n",
       "      <td>-0.042535</td>\n",
       "      <td>0.004055</td>\n",
       "      <td>-0.060600</td>\n",
       "      <td>0.175812</td>\n",
       "      <td>-0.688864</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.873398</td>\n",
       "      <td>-0.318944</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Family_Small</th>\n",
       "      <td>0.002975</td>\n",
       "      <td>0.279855</td>\n",
       "      <td>-0.255196</td>\n",
       "      <td>-0.030395</td>\n",
       "      <td>0.253590</td>\n",
       "      <td>0.248532</td>\n",
       "      <td>0.197468</td>\n",
       "      <td>0.159594</td>\n",
       "      <td>-0.122491</td>\n",
       "      <td>-0.062909</td>\n",
       "      <td>...</td>\n",
       "      <td>0.141925</td>\n",
       "      <td>0.102432</td>\n",
       "      <td>0.068007</td>\n",
       "      <td>0.012756</td>\n",
       "      <td>0.071874</td>\n",
       "      <td>-0.211367</td>\n",
       "      <td>0.302640</td>\n",
       "      <td>-0.873398</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.183007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Family_Large</th>\n",
       "      <td>-0.063415</td>\n",
       "      <td>-0.125147</td>\n",
       "      <td>-0.077748</td>\n",
       "      <td>-0.172922</td>\n",
       "      <td>0.699681</td>\n",
       "      <td>0.624627</td>\n",
       "      <td>0.170916</td>\n",
       "      <td>-0.092825</td>\n",
       "      <td>-0.018423</td>\n",
       "      <td>0.093671</td>\n",
       "      <td>...</td>\n",
       "      <td>0.001362</td>\n",
       "      <td>-0.049336</td>\n",
       "      <td>-0.046485</td>\n",
       "      <td>-0.033009</td>\n",
       "      <td>-0.017542</td>\n",
       "      <td>0.056438</td>\n",
       "      <td>0.801623</td>\n",
       "      <td>-0.318944</td>\n",
       "      <td>-0.183007</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>31 rows × 31 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                PassengerId  Survived       Sex       Age     SibSp     Parch  \\\n",
       "PassengerId        1.000000 -0.005007  0.013406  0.025161 -0.055224  0.008942   \n",
       "Survived          -0.005007  1.000000 -0.543351 -0.072174 -0.035322  0.081629   \n",
       "Sex                0.013406 -0.543351  1.000000  0.060982 -0.109609 -0.213125   \n",
       "Age                0.025161 -0.072174  0.060982  1.000000 -0.214720 -0.130326   \n",
       "SibSp             -0.055224 -0.035322 -0.109609 -0.214720  1.000000  0.373587   \n",
       "Parch              0.008942  0.081629 -0.213125 -0.130326  0.373587  1.000000   \n",
       "Fare               0.031128  0.257307 -0.185681  0.179594  0.160349  0.221635   \n",
       "Embarked_C         0.048101  0.168240 -0.066564  0.080710 -0.048396 -0.008635   \n",
       "Embarked_Q         0.011585  0.003650 -0.088651 -0.059136 -0.048678 -0.100943   \n",
       "Embarked_S        -0.049836 -0.149683  0.115193 -0.033604  0.073709  0.071881   \n",
       "Pclass_1           0.026495  0.285904 -0.107371  0.379932 -0.034256 -0.013033   \n",
       "Pclass_2           0.022714  0.093349 -0.028862  0.000812 -0.052419 -0.010057   \n",
       "Pclass_3          -0.041544 -0.322308  0.116562 -0.329402  0.072610  0.019521   \n",
       "Pclass_Master      0.002254  0.085221  0.164375 -0.405676  0.329171  0.253482   \n",
       "Pclass_Miss       -0.050027  0.332795 -0.672819 -0.288746  0.077564  0.066473   \n",
       "Pclass_Mr          0.014116 -0.549199  0.870678  0.184094 -0.243104 -0.304780   \n",
       "Pclass_Mrs         0.033299  0.344935 -0.571176  0.231678  0.061643  0.213491   \n",
       "Pclass_Officer     0.002231 -0.031316  0.087288  0.172664 -0.013813 -0.032631   \n",
       "Pclass_Royalty     0.004400  0.033391 -0.020408  0.060550 -0.010787 -0.030197   \n",
       "Cabin_A           -0.002831  0.022287  0.047561  0.125848 -0.039808 -0.030707   \n",
       "Cabin_B            0.015895  0.175095 -0.094453  0.120073 -0.011569  0.073051   \n",
       "Cabin_C            0.006092  0.114652 -0.077473  0.175148  0.048616  0.009601   \n",
       "Cabin_D            0.000549  0.150716 -0.057396  0.137439 -0.015727 -0.027385   \n",
       "Cabin_E           -0.008136  0.145321 -0.040340  0.109333 -0.027180  0.001084   \n",
       "Cabin_F            0.000306  0.057935 -0.006655 -0.071171 -0.008619  0.020481   \n",
       "Cabin_G           -0.051389  0.002496 -0.067649 -0.061526  0.000075  0.048231   \n",
       "Cabin_U            0.000208 -0.316912  0.137396 -0.284174  0.009064 -0.036806   \n",
       "FamilySize        -0.031437  0.016639 -0.188583 -0.212466  0.861952  0.792296   \n",
       "Family_Single      0.028546 -0.203367  0.284537  0.114964 -0.591077 -0.549022   \n",
       "Family_Small       0.002975  0.279855 -0.255196 -0.030395  0.253590  0.248532   \n",
       "Family_Large      -0.063415 -0.125147 -0.077748 -0.172922  0.699681  0.624627   \n",
       "\n",
       "                    Fare  Embarked_C  Embarked_Q  Embarked_S  ...   Cabin_C  \\\n",
       "PassengerId     0.031128    0.048101    0.011585   -0.049836  ...  0.006092   \n",
       "Survived        0.257307    0.168240    0.003650   -0.149683  ...  0.114652   \n",
       "Sex            -0.185681   -0.066564   -0.088651    0.115193  ... -0.077473   \n",
       "Age             0.179594    0.080710   -0.059136   -0.033604  ...  0.175148   \n",
       "SibSp           0.160349   -0.048396   -0.048678    0.073709  ...  0.048616   \n",
       "Parch           0.221635   -0.008635   -0.100943    0.071881  ...  0.009601   \n",
       "Fare            1.000000    0.286368   -0.129958   -0.170068  ...  0.401427   \n",
       "Embarked_C      0.286368    1.000000   -0.164166   -0.778262  ...  0.158043   \n",
       "Embarked_Q     -0.129958   -0.164166    1.000000   -0.491656  ... -0.059151   \n",
       "Embarked_S     -0.170068   -0.778262   -0.491656    1.000000  ... -0.101861   \n",
       "Pclass_1        0.600085    0.325722   -0.166101   -0.181800  ...  0.485974   \n",
       "Pclass_2       -0.121222   -0.134675   -0.121973    0.196532  ... -0.144104   \n",
       "Pclass_3       -0.419851   -0.171430    0.243706   -0.003805  ... -0.302359   \n",
       "Pclass_Master   0.011657   -0.014172   -0.009091    0.018297  ... -0.047456   \n",
       "Pclass_Miss     0.092185   -0.014351    0.198804   -0.113886  ... -0.013418   \n",
       "Pclass_Mr      -0.192420   -0.065538   -0.080224    0.108924  ... -0.068072   \n",
       "Pclass_Mrs      0.139346    0.098379   -0.100374   -0.022950  ...  0.112164   \n",
       "Pclass_Officer  0.028731    0.003678   -0.003212   -0.001202  ...  0.052889   \n",
       "Pclass_Royalty  0.026232    0.077213   -0.021853   -0.054250  ...  0.024932   \n",
       "Cabin_A         0.020130    0.094914   -0.042105   -0.056984  ... -0.036366   \n",
       "Cabin_B         0.393787    0.161595   -0.073613   -0.095790  ... -0.063580   \n",
       "Cabin_C         0.401427    0.158043   -0.059151   -0.101861  ...  1.000000   \n",
       "Cabin_D         0.072786    0.107782   -0.061459   -0.056023  ... -0.053083   \n",
       "Cabin_E         0.073995    0.027566   -0.042877    0.002960  ... -0.050016   \n",
       "Cabin_F        -0.037529   -0.020010   -0.020282    0.030575  ... -0.035516   \n",
       "Cabin_G        -0.020371   -0.034592   -0.021853    0.044448  ... -0.018875   \n",
       "Cabin_U        -0.507321   -0.258257    0.142369    0.137351  ... -0.515684   \n",
       "FamilySize      0.226609   -0.036553   -0.087190    0.087771  ...  0.037226   \n",
       "Family_Single  -0.275037   -0.107874    0.127214    0.014246  ... -0.137498   \n",
       "Family_Small    0.197468    0.159594   -0.122491   -0.062909  ...  0.141925   \n",
       "Family_Large    0.170916   -0.092825   -0.018423    0.093671  ...  0.001362   \n",
       "\n",
       "                 Cabin_D   Cabin_E   Cabin_F   Cabin_G   Cabin_U  FamilySize  \\\n",
       "PassengerId     0.000549 -0.008136  0.000306 -0.051389  0.000208   -0.031437   \n",
       "Survived        0.150716  0.145321  0.057935  0.002496 -0.316912    0.016639   \n",
       "Sex            -0.057396 -0.040340 -0.006655 -0.067649  0.137396   -0.188583   \n",
       "Age             0.137439  0.109333 -0.071171 -0.061526 -0.284174   -0.212466   \n",
       "SibSp          -0.015727 -0.027180 -0.008619  0.000075  0.009064    0.861952   \n",
       "Parch          -0.027385  0.001084  0.020481  0.048231 -0.036806    0.792296   \n",
       "Fare            0.072786  0.073995 -0.037529 -0.020371 -0.507321    0.226609   \n",
       "Embarked_C      0.107782  0.027566 -0.020010 -0.034592 -0.258257   -0.036553   \n",
       "Embarked_Q     -0.061459 -0.042877 -0.020282 -0.021853  0.142369   -0.087190   \n",
       "Embarked_S     -0.056023  0.002960  0.030575  0.044448  0.137351    0.087771   \n",
       "Pclass_1        0.275698  0.242963 -0.073083 -0.012606 -0.776987   -0.029656   \n",
       "Pclass_2       -0.037929 -0.050210  0.127371 -0.035156  0.176485   -0.039976   \n",
       "Pclass_3       -0.207455 -0.169063 -0.041178  0.039726  0.527614    0.058430   \n",
       "Pclass_Master  -0.042192  0.001860  0.058311 -0.015002  0.041178    0.355061   \n",
       "Pclass_Miss    -0.012516  0.008700 -0.003088  0.050853 -0.004364    0.087350   \n",
       "Pclass_Mr      -0.030261 -0.032953 -0.026403 -0.056564  0.131807   -0.326487   \n",
       "Pclass_Mrs      0.080393  0.045538  0.013376  0.034052 -0.162253    0.157233   \n",
       "Pclass_Officer  0.006055 -0.024048 -0.017076 -0.009075 -0.067030   -0.026921   \n",
       "Pclass_Royalty -0.012950 -0.012202 -0.008665 -0.004605 -0.071672   -0.023600   \n",
       "Cabin_A        -0.024952 -0.023510 -0.016695 -0.008872 -0.242399   -0.042967   \n",
       "Cabin_B        -0.043624 -0.041103 -0.029188 -0.015511 -0.423794    0.032318   \n",
       "Cabin_C        -0.053083 -0.050016 -0.035516 -0.018875 -0.515684    0.037226   \n",
       "Cabin_D         1.000000 -0.034317 -0.024369 -0.012950 -0.353822   -0.025313   \n",
       "Cabin_E        -0.034317  1.000000 -0.022961 -0.012202 -0.333381   -0.017285   \n",
       "Cabin_F        -0.024369 -0.022961  1.000000 -0.008665 -0.236733    0.005525   \n",
       "Cabin_G        -0.012950 -0.012202 -0.008665  1.000000 -0.125809    0.026411   \n",
       "Cabin_U        -0.353822 -0.333381 -0.236733 -0.125809  1.000000   -0.014155   \n",
       "FamilySize     -0.025313 -0.017285  0.005525  0.026411 -0.014155    1.000000   \n",
       "Family_Single  -0.074310 -0.042535  0.004055 -0.060600  0.175812   -0.688864   \n",
       "Family_Small    0.102432  0.068007  0.012756  0.071874 -0.211367    0.302640   \n",
       "Family_Large   -0.049336 -0.046485 -0.033009 -0.017542  0.056438    0.801623   \n",
       "\n",
       "                Family_Single  Family_Small  Family_Large  \n",
       "PassengerId          0.028546      0.002975     -0.063415  \n",
       "Survived            -0.203367      0.279855     -0.125147  \n",
       "Sex                  0.284537     -0.255196     -0.077748  \n",
       "Age                  0.114964     -0.030395     -0.172922  \n",
       "SibSp               -0.591077      0.253590      0.699681  \n",
       "Parch               -0.549022      0.248532      0.624627  \n",
       "Fare                -0.275037      0.197468      0.170916  \n",
       "Embarked_C          -0.107874      0.159594     -0.092825  \n",
       "Embarked_Q           0.127214     -0.122491     -0.018423  \n",
       "Embarked_S           0.014246     -0.062909      0.093671  \n",
       "Pclass_1            -0.126551      0.165965     -0.067523  \n",
       "Pclass_2            -0.035075      0.097270     -0.118495  \n",
       "Pclass_3             0.138250     -0.223338      0.155560  \n",
       "Pclass_Master       -0.265355      0.120166      0.301809  \n",
       "Pclass_Miss         -0.023890     -0.018085      0.083422  \n",
       "Pclass_Mr            0.386262     -0.300872     -0.194207  \n",
       "Pclass_Mrs          -0.354649      0.361247      0.012893  \n",
       "Pclass_Officer       0.013303      0.003966     -0.034572  \n",
       "Pclass_Royalty       0.008761     -0.000073     -0.017542  \n",
       "Cabin_A              0.045227     -0.029546     -0.033799  \n",
       "Cabin_B             -0.087912      0.084268      0.013470  \n",
       "Cabin_C             -0.137498      0.141925      0.001362  \n",
       "Cabin_D             -0.074310      0.102432     -0.049336  \n",
       "Cabin_E             -0.042535      0.068007     -0.046485  \n",
       "Cabin_F              0.004055      0.012756     -0.033009  \n",
       "Cabin_G             -0.060600      0.071874     -0.017542  \n",
       "Cabin_U              0.175812     -0.211367      0.056438  \n",
       "FamilySize          -0.688864      0.302640      0.801623  \n",
       "Family_Single        1.000000     -0.873398     -0.318944  \n",
       "Family_Small        -0.873398      1.000000     -0.183007  \n",
       "Family_Large        -0.318944     -0.183007      1.000000  \n",
       "\n",
       "[31 rows x 31 columns]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#相关性矩阵\n",
    "corrDf = full_data.corr() \n",
    "corrDf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Survived          1.000000\n",
       "Pclass_Mrs        0.344935\n",
       "Pclass_Miss       0.332795\n",
       "Pclass_1          0.285904\n",
       "Family_Small      0.279855\n",
       "Fare              0.257307\n",
       "Cabin_B           0.175095\n",
       "Embarked_C        0.168240\n",
       "Cabin_D           0.150716\n",
       "Cabin_E           0.145321\n",
       "Cabin_C           0.114652\n",
       "Pclass_2          0.093349\n",
       "Pclass_Master     0.085221\n",
       "Parch             0.081629\n",
       "Cabin_F           0.057935\n",
       "Pclass_Royalty    0.033391\n",
       "Cabin_A           0.022287\n",
       "FamilySize        0.016639\n",
       "Embarked_Q        0.003650\n",
       "Cabin_G           0.002496\n",
       "PassengerId      -0.005007\n",
       "Pclass_Officer   -0.031316\n",
       "SibSp            -0.035322\n",
       "Age              -0.072174\n",
       "Family_Large     -0.125147\n",
       "Embarked_S       -0.149683\n",
       "Family_Single    -0.203367\n",
       "Cabin_U          -0.316912\n",
       "Pclass_3         -0.322308\n",
       "Sex              -0.543351\n",
       "Pclass_Mr        -0.549199\n",
       "Name: Survived, dtype: float64"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "查看各个特征与生成情况（Survived）的相关系数，\n",
    "ascending=False表示按降序排列\n",
    "'''\n",
    "corrDf['Survived'].sort_values(ascending =False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pclass_Master</th>\n",
       "      <th>Pclass_Miss</th>\n",
       "      <th>Pclass_Mr</th>\n",
       "      <th>Pclass_Mrs</th>\n",
       "      <th>Pclass_Officer</th>\n",
       "      <th>Pclass_Royalty</th>\n",
       "      <th>Pclass_1</th>\n",
       "      <th>Pclass_2</th>\n",
       "      <th>Pclass_3</th>\n",
       "      <th>FamilySize</th>\n",
       "      <th>...</th>\n",
       "      <th>Cabin_C</th>\n",
       "      <th>Cabin_D</th>\n",
       "      <th>Cabin_E</th>\n",
       "      <th>Cabin_F</th>\n",
       "      <th>Cabin_G</th>\n",
       "      <th>Cabin_U</th>\n",
       "      <th>Embarked_C</th>\n",
       "      <th>Embarked_Q</th>\n",
       "      <th>Embarked_S</th>\n",
       "      <th>Sex</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pclass_Master  Pclass_Miss  Pclass_Mr  Pclass_Mrs  Pclass_Officer  \\\n",
       "0              0            0          1           0               0   \n",
       "1              0            0          0           1               0   \n",
       "2              0            1          0           0               0   \n",
       "3              0            0          0           1               0   \n",
       "4              0            0          1           0               0   \n",
       "\n",
       "   Pclass_Royalty  Pclass_1  Pclass_2  Pclass_3  FamilySize  ...  Cabin_C  \\\n",
       "0               0         0         0         1           2  ...        0   \n",
       "1               0         1         0         0           2  ...        1   \n",
       "2               0         0         0         1           1  ...        0   \n",
       "3               0         1         0         0           2  ...        1   \n",
       "4               0         0         0         1           1  ...        0   \n",
       "\n",
       "   Cabin_D  Cabin_E  Cabin_F  Cabin_G  Cabin_U  Embarked_C  Embarked_Q  \\\n",
       "0        0        0        0        0        1           0           0   \n",
       "1        0        0        0        0        0           1           0   \n",
       "2        0        0        0        0        1           0           0   \n",
       "3        0        0        0        0        0           0           0   \n",
       "4        0        0        0        0        1           0           0   \n",
       "\n",
       "   Embarked_S  Sex  \n",
       "0           1    1  \n",
       "1           0    0  \n",
       "2           1    0  \n",
       "3           1    0  \n",
       "4           1    1  \n",
       "\n",
       "[5 rows x 26 columns]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#特征选择\n",
    "full_data_X = pd.concat( [titleDf,#头衔\n",
    "                     pclassDf,#客舱等级\n",
    "                     familyDf,#家庭大小\n",
    "                     full_data['Fare'],#船票价格\n",
    "                     cabinDf,#船舱号\n",
    "                     embarkedDf,#登船港口\n",
    "                     full_data['Sex']#性别\n",
    "                    ] , axis=1 )\n",
    "full_data_X.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 构建模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "#原始数据集有891行\n",
    "sourceRow=len(train_data)\n",
    "\n",
    "'''\n",
    "sourceRow是我们在最开始合并数据前知道的，原始数据集有总共有891条数据\n",
    "从特征集合full_X中提取原始数据集提取前891行数据时，我们要减去1，因为行号是从0开始的。\n",
    "'''\n",
    "#原始数据集：特征\n",
    "source_X = full_data_X.loc[0:sourceRow-1,:]\n",
    "#原始数据集：标签\n",
    "source_y = full_data.loc[0:sourceRow-1,'Survived']   \n",
    "\n",
    "#预测数据集：特征\n",
    "pred_X = full_data_X.loc[sourceRow:,:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split \n",
    "\n",
    "#建立模型用的训练数据集和测试数据集\n",
    "train_X, test_X, train_y, test_y = train_test_split(source_X ,\n",
    "                                                    source_y,\n",
    "                                                    train_size=.8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "model = LogisticRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression()"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fit( train_X , train_y )\n",
    "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
    "                   intercept_scaling=1, l1_ratio=None, max_iter=100,\n",
    "                   multi_class='auto', n_jobs=None, penalty='l2',\n",
    "                   random_state=None, solver='lbfgs', tol=0.0001, verbose=0,\n",
    "                   warm_start=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8268156424581006"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.score(test_X , test_y )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "#使用机器学习模型，对预测数据集中的生存情况进行预测\n",
    "pred_Y = model.predict(pred_X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 结果分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlYAAAJOCAYAAAB1IEnpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJz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1V1Y1V9/66t7sS0zEzekOQbsvFG2Dcn+ZHu/sLuLI+HsLKf9Tv1kTarsu1H6Sy5D7OW/jOvqoPZCKtn7+iKWGYmP5vkx7v7wY3/iLMLlpnLyUmekeQ5Sf52kt+rquu7+493enEnqGVm8twkNyX5R0n+QZJrq+r/dPdndnpxPKSV/aw/3sJqmY/S8XE7u2+pP/Oq+odJfjHJ87r7L3dpbSeqZWayP8mhRVSdnuT5VfVAd//q7izxhLTsv2Gf6u77k9xfVdcl+cYkwmpnLDOTH0jy2t745Z7bqupjSb4+yQd2Z4lsYWU/64+3pwKX+Sida5J8/+IVA89Kcl93f3K3F3qC2XYuVfXkJO9K8hL/894V286ku8/p7n3dvS/JO5L8K1G145b5N+zqJN9eVSdX1Vck+ZYkt+7yOk8ky8zk49l4BDFVtTfJ1yX5011dJUdb2c/64+oRq36Ij9Kpqh9eXP7z2Xh10/OT3Jbkr7LxPw120JJz+Q9J/m6SNy4eIXmgfWL8jllyJuyyZebS3bdW1a8n+VCSLyT5xe7e8iXnHLsl/668JskVVXVzNp6C+vHu/tTKFn0CqKq3JzmQ5PSquiPJq5J8ebL6n/U+0gYAYMjx9lQgAMDKCCsAgCHCCgBgiLACABgirAAAhggrAIAhwgoAYMj/B7u1WuHt9zIGAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 720x720 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 预测结果可视化                                                                                                                                                    \n",
    "lr_pred = pd.DataFrame(pred_Y,columns=['Survived'])\n",
    "lr_pred.hist(figsize=(10,10))\n",
    "plt.show()\n",
    "\n",
    "homePath = \"data\"\n",
    "submitPath = os.path.join(homePath, \"gender_submission.csv\")\n",
    "submitData = pd.read_csv(submitPath)\n",
    "# 保存预测的结果\n",
    "submitData['Survived'] = lr_pred\n",
    "submitData.to_csv(\"my_prediction.csv\", index=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 总结\n",
    "* 在这次实验中，我使用了逻辑回归算法去建模，其实也可以选择更多算法比如决策树，随机森林，梯度提升树，SVM等等的算法去建模。每个算法的表现都不同。可以先用这些算法去全部建模一遍，再从中挑选出最优的算法去调参，这是我后续继续优化的一个方向。\n",
    "* 通过本次实验，我深刻认识到了数据和特征决定了机器学习的上限，而模型和算法只是逼近这个上限而已，特征工程占据了机器学习中很大的一部分工作占比。\n",
    "* 数据预处理是一个很重要的步骤，报告2的数据中每个维度的数据不全是数字，还有字符串和空值，这就需要先将字符串转换为对应编码，把空缺值处理，通过本实验学到了很多DataFrame的操作方式，收获很大。\n",
    "* 针对分类问题，利用原始信息和数据创建与目标值相关性更高的特征也是需要未来不断思考和优化的问题。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "main_language": "python"
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
